import request from '@/utils/request'
import qs from "qs"
export default {
    //获取所有区域信息
    findAreas() {
        return request({
            url: `/api-sys/area/areas`,
            method: 'get'
        })
    },
    //获取对应层级之前的所有区域信息
    findLayeredAreas(tier) {
        return request({
            url: `/api-sys/area/areas/${tier}`,
            method: 'get'
        })
    },
    //新增区域信息
    addArea(name, parentId,tier) {
        var data = qs.stringify({ "name": name, "parentId": parentId ,"tier": tier})
        return request({
            url: '/api-sys/area/addArea',
            method: 'post',
            data
        })
    }

}